<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<!DOCTYPE html>
<html>
	<head>
		<title>编辑会员</title>
		<meta name="decorator" content="default"/>
		<script type="text/javascript">
			$(function() {
				//初始化表单验证
				$("#inputForm").initValidform();
			});
			
			function getCity(){
				var proviceid = $("#province option:selected").val();
	            $.post("${ctx}/sys/area/ajax?method=getchilds", { "parentid": proviceid },function (result) {
                    if (result != "") {
                        $("#city").html(result);
                        $('.rule-single-select').ruleSingleSelect();
                   	}
                }, "text");
			}
			
			function getArea(){
				var proviceid = $("#city option:selected").val();
	            $.post("${ctx}/sys/area/ajax?method=getarea", { "parentid": proviceid },function (result) {
                    if (result != "") {
                        $("#area").html(result);
                        $('.rule-single-select').ruleSingleSelect();
                   	}
                }, "text");
			}
		</script>
	</head>
	
	<body class="mainbody">
		<form:form id="inputForm" modelAttribute="member" action="${ctx}/qd/member/save" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<!--导航栏-->
			<div class="location">
				<a href="${ctx}/qd/member/list" class="back"><i></i><span>返回列表页</span></a>
				<a href="${ctx}/center" class="home"><i></i><span>首页</span></a> 
				<i class="arrow"></i> 
				<a href="${ctx}/qd/member/"><span>会员管理</span></a>
				<shiro:hasPermission name="qd:member:edit"><i class="arrow"></i><span>${not empty member.id ? '修改':'添加' }会员</span></shiro:hasPermission>
			</div>	
			<div class="line10"></div>
			<!--/导航栏-->
	
			<!--内容-->
			<div id="floatHead" class="content-tab-wrap">
				<div class="content-tab">
					<div class="content-tab-ul-wrap">
						<ul>
							<li><a class="selected" href="javascript:;">会员信息</a></li>
						</ul>
					</div>
				</div>
			</div>
	
			<div class="tab-content"  style="height:500px">
				<div style=" width:100%">
					<div style="float: left;width:33%;height: ">
						<dl>
							<dt>省份</dt>
							<dd>
								<div class="rule-single-select single-select">
									<form:select id="province" path="proviceId" onchange="getCity();" datatype="*" errormsg="请选择省份" sucmsg=" "  nullmsg="请选择省份" >
										<form:option value=""  selected="selected"  label="请选择..."/>
										<form:options items="${provinceList}" itemLabel="name" itemValue="id"/>
									</form:select>
								</div>
							</dd>
						</dl>
					</div>
					<div style="float: left;width:33%">
						<dl>
							<dt>城市</dt>
							<dd>
								<div class="rule-single-select single-select">
									<form:select id="city" path="cityId"  onchange="getArea();" datatype="*" errormsg="请选择城市" sucmsg=" "  nullmsg="请选择城市"  >
										<form:option value=""  selected="selected"  label="请选择..."/>
										<form:options items="${cityList}" itemLabel="name" itemValue="id"/>
									</form:select>
								</div>
							</dd>
						</dl>
					</div>
					<div style="float: left;width:33%">
						<dl>
							<dt>区域</dt>
							<dd>
								<div class="rule-single-select single-select">
									<form:select id="area"  path="areaId" datatype="*" errormsg="请选择区域" sucmsg=" "  nullmsg="请选择区域"  >
										<form:option value=""  selected="selected"  label="请选择..."/>
										<form:options tabindex="1" items="${areaList}" itemLabel="name" itemValue="id"/>
									</form:select>
								</div>
							</dd>
						</dl>
					</div>
				</div>
				<dl>
					<dt>手机号</dt>
					<dd>
						<form:input path="mobile" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入手机号" errormsg="请输入手机号" sucmsg=" "/>
						<span class="Validform_checktip">*请输入手机号</span>
					</dd>
				</dl>
				<dl style="display: none">
					<dt>登录密码</dt>
					<dd>
						<form:input path="password" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入登录密码" errormsg="请输入登录密码" sucmsg=" "/>
						<span class="Validform_checktip">*请输入登录密码</span>
					</dd>
				</dl>
				<dl>
					<dt>会员昵称</dt>
					<dd>
						<form:input path="nikename" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入会员昵称" errormsg="请输入会员昵称" sucmsg=" "/>
						<span class="Validform_checktip">*请输入会员昵称</span>
					</dd>
				</dl>
				<dl>
					<dt>会员姓名</dt>
					<dd>
						<form:input path="name" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入会员姓名" errormsg="请输入会员姓名" sucmsg=" "/>
						<span class="Validform_checktip">*请输入会员姓名</span>
					</dd>
				</dl>
				<dl>
					<dt>地址</dt>
					<dd>
						<form:input path="address" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入地址" errormsg="请输入地址" sucmsg=" "/>
						<span class="Validform_checktip">*请输入地址</span>
					</dd>
				</dl>
				<dl>
					<dt>是否禁用</dt>
					<dd>
						<div class="rule-multi-radio">
							<form:radiobuttons path="loginFlag"  items="${fns:getDictList('yesno')}"  itemValue="value"  itemLabel="label" htmlEscape="false"  class="required" />
						</div>
					</dd>
				</dl>
			</div>
			<!--/内容-->
	
			<!--工具栏-->
			<div class="page-footer">
				<div class="btn-wrap">
					<input type="submit" name="btnSubmit" value="提交保存" id="btnSubmit" class="btn" /> 
					<input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
				</div>
			</div>
			<!--/工具栏-->
		</form:form>
	</body>
</html>

